package dao.oc_sea_area_pla;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import entitybean.oc_property_ice.EntityBean_Oc_Property_Ice;
import entitybean.oc_sea_area_ice.EntityBeanOc_Sea_Area_Ice;
import entitybean.oc_sea_area_pla.EntityBeanOc_Sea_Area_Pla;
public class DaoImpl_Oc_Sea_Area_Pla  extends HibernateDaoSupport implements Dao_Oc_Sea_Area_Pla{
	public void Insert_Oc_Sea_Area_Pla(EntityBeanOc_Sea_Area_Pla e)
	{
		this.getHibernateTemplate().save(e);
	}
	public void Update_Oc_Sea_Area_Pla(EntityBeanOc_Sea_Area_Pla e)
	{
		this.getHibernateTemplate().update(e);
	}
	public void Delete_Oc_Sea_Area_Pla(String id)
	{
		List<EntityBeanOc_Sea_Area_Pla> list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Pla where del='OFF' and id in("+id+")");	
		for(int i=0;i<list.size();i++)
		{
			EntityBeanOc_Sea_Area_Pla e=list.get(i);
			e.setDel("ON");
			this.getHibernateTemplate().update(e);
			
		}
	}
	@SuppressWarnings("unchecked")
	public EntityBeanOc_Sea_Area_Pla Find_EntityBeanOc_Sea_Area_Pla(Integer id)
	{
		EntityBeanOc_Sea_Area_Pla e=new EntityBeanOc_Sea_Area_Pla();
		List<EntityBeanOc_Sea_Area_Pla> list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Pla where id="+id);
		if(list.size()>0)
		{
			e=list.get(0);
		}
		return e;
	}
	public List<EntityBeanOc_Sea_Area_Pla> Find_EntityBeanOc_Sea_Area_Pla() {
		List<EntityBeanOc_Sea_Area_Pla> list=new ArrayList<EntityBeanOc_Sea_Area_Pla>();
		list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Pla where del='OFF' ");
		return list;
	}
	public List<EntityBeanOc_Sea_Area_Pla> Find_Oc_Sea_Area_Pla_ISACTIVE()
	{
		return this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Pla where del='OFF'");
		
	}
}
